/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
}

header h1 {
    color: #ff6b9d;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header .subtitle {
    color: #4a9ff5;
    font-size: 1.2rem;
}

/* 主要内容区域 */
main {
    margin-bottom: 30px;
}

/* Tab导航样式 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 12px 24px;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.tab-button.active {
    background-color: #4a9ff5;
    color: white;
}

.tab-button:hover:not(.active) {
    background-color: #ddd;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 内容布局 */
.content-layout {
    display: flex;
    gap: 20px;
}

.form-section {
    flex: 1;
    min-width: 300px;
}

.timeline-section {
    flex: 1;
    min-width: 300px;
}

@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }
}

/* 时间轴筛选控件 */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-header h3 {
    color: #4a9ff5;
    margin: 0;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-controls label {
    font-weight: bold;
    white-space: nowrap;
}

.filter-controls select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* 配置区域样式 */
.config-section {
    background-color: #eef7ff;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.config-section h3 {
    color: #4a9ff5;
    margin-top: 0;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-refresh {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #ff6b9d;
    color: white;
}

.btn-primary:hover {
    background-color: #ff5588;
}

.btn-secondary {
    background-color: #4a9ff5;
    color: white;
}

.btn-secondary:hover {
    background-color: #3a8fe5;
}

.btn-refresh {
    background-color: #6c757d;
    color: white;
    margin-top: 10px;
}

.btn-refresh:hover {
    background-color: #5a6268;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* 喂养管理样式 */
.feeding-status {
    background-color: #fff5f7;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.next-feeding h3 {
    color: #4a9ff5;
}

#nextFeedingTime {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
}

#feedingMessage.due {
    color: #ff6b9d;
    font-weight: bold;
    font-size: 1.3rem;
}

.quick-record {
    margin-top: 15px;
}

.timeline {
    list-style: none;
    position: relative;
    padding: 30px 0 30px 30px;
    max-height: 600px;
    overflow-y: auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    background: #4a9ff5;
    top: 0;
    bottom: 0;
    left: 15px;
}

.timeline li {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline li:before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4a9ff5;
    left: -21px;
    top: 20px;
}

.timeline-actions {
    margin-top: 10px;
}

.timeline-actions button {
    margin-right: 10px;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.edit-btn {
    background-color: #ffc107;
    color: #212529;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* 喂养记录样式 */
.feeding-record,
.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-details,
.event-details {
    flex-grow: 1;
}

.record-time,
.event-date {
    font-weight: bold;
    color: #4a9ff5;
}

.record-type,
.event-category {
    color: #ff6b9d;
    font-size: 0.9rem;
}

.record-amount {
    color: #6c757d;
    font-size: 0.9rem;
}

.event-content {
    font-style: italic;
    margin: 5px 0;
    color: #495057;
}

/* 编辑表单样式 */
.edit-form {
    background: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.edit-form h4 {
    margin-top: 0;
}

/* 黄金价格信息样式 */
.gold-price-item {
    margin-bottom: 15px;
}

.gold-price-item h4 {
    color: #ff6b9d;
    margin-bottom: 10px;
}

.gold-price-item p {
    margin: 5px 0;
}

.market-info {
    background-color: #fff5f7;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.market-links {
    background-color: #eef7ff;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

.market-category {
    margin-bottom: 20px;
}

.market-category h3 {
    color: #4a9ff5;
    margin-bottom: 10px;
}

.market-link-btn {
    display: inline-block;
    margin: 5px 5px 5px 0;
    text-decoration: none;
}

/* 备注字段样式 */
.record-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    color: #666;
    border-top: 1px solid #eaeaea;
}

footer p {
    margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
    }
    
    .feeding-record,
    .event-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .record-actions,
    .event-actions {
        margin-top: 10px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
}